<?php
namespace app\modules\adminapi\controllers;

use fate\http\Request;
use app\models\UserRoles;

class DeleteroleController extends \app\modules\adminapi\ForceLoginPure {

    public function run() {
        $req = Request::getInstance();
        $id = $req->getParameter('id');

        if(!is_numeric($id)) {
            $this->ajaxReturn(null, 300002);
            exit;
        }

        $model = new UserRoles();
        $model->delete($id);

        $this->ajaxReturn(null);
    }

}
